<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" >

    <script type="text/javascript" src="comet.js"></script>
    <script type="text/javascript" charset="utf-8">
       //document.domain = extract_xss_domain(document.domain);
    </script>
    
    <style type="text/css">
        a:link { color: #0000cc; }
        body { background: #fff; margin: 3px 8px;}
        body, select, input { font-family: arial, sans-serif;}
        body { font-size: 83%;}
        body, html{height:100%;}
        body {
/*              font-size: 83%; */
            font-family: monospace, arial, sans-serif;
            border-collapse: separate;
        }
        #box {height:100%; width:100%}

    </style>
</head>
<body>
counter_max:<input value="1000" id="counter_max"></input><br>
delay:<input value="1000" id="delay"></input><br>
<pre id="box"></pre>

<script type="text/javascript">
    var box = document.getElementById("box");
    var counter = 0;

    function gogo(){
        counter += 1;
        if(counter >= document.getElementById("counter_max").value)
            return;
        var xhr;
        var ors = function(){
            if(!xhr) return;
            if(xhr.readyState==4){
                var response = xhr.responseText;
                if(xhr.status!=200){
                    return;
                }
                box.innerHTML = response;
                setTimeout(gogo, document.getElementById("delay").value);
            }
        }
        comet_log(counter);
        xhr = comet_create_ajax('/greed/welcome_document/input/'+counter+'/', 'GET', '', ors);
    }
    gogo();
    
</script>
</body>
</html>